<template>
    <div class="hospital_cell">

        <!-- 医院头像 开始 -->
        <div class="avatar" @click="lookDetail()">
            <li-image :src="info.hospitalLogo" class="img" v-if="info.hospitalLogo" :alt="`${$cookies.get('city') || '全国'}${info.hospitalName}资质`" />
            <TextLogo v-else-if="info.textLogo" :name="info.textLogo" />
            <img src="@/assets/images/avatar/hosp_detail_default.png" class="img" :alt="`${$cookies.get('city') || '全国'}${info.hospitalName}资质`" v-else />
        </div>
        <!-- 医院头像 end -->

        <!-- 医院信息 开始 -->
        <div class="hospital_info">
            <div class="hospital_name" @click="lookDetail()">{{ info.hospitalName }}</div>
            <div class="labels_list" v-if="info.featuredLabels && info.featuredLabels.length">
                <div class="label" :class="getClassName(index)" v-for="(item, index) in (info.featuredLabels || [])"
                    :key="`label_${index}`">{{ item }}</div>
            </div>
            <!-- <div class="score_box">
                <div class="score">
                    <el-rate v-model="info.initScore" disabled allow-half></el-rate>
                </div>
                <div class="review">11474条评价</div>
            </div> -->
            <div class="time_box">
                <span>法人代表：{{ info.legalPerson }}</span>
            </div>
            <div class="time_box">
                <span>注册资金：{{ info.registeredCapital }}</span>
            </div>
            <div class="time_box">
                <!-- <span>法人代表：{{ info.legalPerson }}</span>
                <span>注册资金：{{ info.registeredCapital }}</span> -->
                <span>成立时间：{{ info.establishDate }}</span>
            </div>
            <div class="address">所在位置:{{ info.provinceName }}{{ info.cityName }}{{ info.districtName }}{{ info.addressName }}</div>
        </div>
        <!-- 医院信息 end -->

    </div>
</template>
<script>
import { Rate } from 'element-ui';
import TextLogo from '@/components/logo/index.vue'
export default {
    name: 'CerHospital',
    props: {
        info: {
            type: Object,
            default: function () {
                return {}
            }
        },
    },
    components: {
        [Rate.name]: Rate,
        TextLogo
    },
    data() {
        return {

        }
    },
    methods: {
        // 查看详情
        lookDetail() {
            let o = this.info
            let query = this.$route.query;
            query.id = o.id
            this.$router.push({
                path: `/certification/hosp/${o.id}`,
            })
        },

        // 动态获取className
        getClassName(index) {
            if (index % 3 == 0) {
                return ''
            }
            if (index % 3 == 1) {
                return 'blue'
            }
            if (index % 3 == 2) {
                return 'dark_blue'
            }
        }
    }
}
</script>
<style lang="less" scoped>
@import './hospital.less';
</style>